import React from 'react';

class Child1 extends React.Component {

  constructor(props) {
    super();
    this.state = {
      child: '',
    };
  }

  static getDerivedStateFromProps(nextProps, prevState) {
    console.log("Child1 getDerivedStateFromProps ...", nextProps, prevState);
    return prevState;
  }

  render() {
    return (
      <div>
        <button onClick={ this.props.onClick }>+ 1</button>
      </div>
    );
  }
}

export default Child1;
